package com.flying.annotation;

import java.util.Date;

/**
 * @author 刘鹏飞
 * @Classname AnnotationTest
 * @Description
 * @Date 2023/10/7 12:55
 * @Created by 刘鹏飞
 */
public class AnnotationTest {

    public static void main(String[] args) {

        Date date=new Date();
        Date date1 = new Date(2022, 12, 4);
        System.out.println(date1);

        Person li = new Person("李明");

        @SuppressWarnings("unused") Person zh = new Person("张量", 11);

        System.out.println(li);

        @SuppressWarnings("unused") int num=10;


    }
}

@MyAnnotation(value="class")
class Person {
    String name;
    int age;

    @Deprecated
    public Person(String name){
        this.name = name;
    }

    @MyAnnotation()
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println("人吃饭");
    }

    public void walk() {
        System.out.println("人走路");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}

class Student extends Person {

    public Student(String name) {
        super(name);
    }

    @Override
    public void eat() {
        System.out.println("学生吃饭");
    }


    @Override
    public void walk() {
        System.out.println("学生走路");
    }

}